package cn.edu.hgu.util;

import java.io.File;
import java.util.Calendar;

public class UploadUtil {
	public static File getDescFile(String path, String fileName) {
		fileName = System.currentTimeMillis() + fileName;
		Calendar now = Calendar.getInstance();
		int year = now.get(Calendar.YEAR);
		int month = now.get(Calendar.MONTH) + 1;
		int day = now.get(Calendar.DAY_OF_MONTH);
		path = path + "/" + year + "/" + month + "/" + day;
		File dirFile = new File(path);
		if (!dirFile.exists()) {
			dirFile.mkdirs();
		}
		return new File(path, fileName);
	}
}
